<template>
  <div>
    <van-nav-bar class="app-nav-bar" title="任务列表" left-arrow @click-left="onClickLeft"/>
        <el-table
      :data="tableData"
      style="width: 100%; margin-bottom: 70px;">
      <el-table-column
        prop="taskName"
        label="任务名称">
      </el-table-column>
      <el-table-column
        prop="taskType"
        label="任务类型">
      </el-table-column>
      <el-table-column
        prop="taskStatus"
        label="任务状态">
      </el-table-column>
      <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button type="primary" v-if="scope.row.eventStatus !=='0'"
          size="mini"
          @click="handleEdit(scope.row)">详情</el-button>
        </template>
    </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
    data(){
        return{
            tableData:[],

        }
    },
    methods:{
        onClickLeft(){
            this.$router.go(-1) 
        },
        handleEdit(row){
            this.$router.push({name: 'TaskDetail', params: { id: row.id}});
        },
        async getUser(){
            const {data:res} =await this.request({
                url:"/app/Task/getTaskListAll"
                });
            console.log(res)
            this.tableData=res.data
        },
    },created(){
        this.getUser();
    }
}
</script>

<style lang="less">

</style>